package com.mcx.modules.data.localdata.create;

import com.mcx.modules.data.GameDataTableParser;
import com.mcx.modules.data.base.AbstractDBModel;

/** WorldMap数据管理 */
public class WorldMapDBModel extends AbstractDBModel<WorldMapDBModel, WorldMapEntity>
{
    private static WorldMapDBModel instance;

    public static WorldMapDBModel getInstance() {
        if (instance == null) {
            instance = new WorldMapDBModel();
        }
        return instance;
    }

    /** 文件名称 */
    @Override
    protected String FileName() {
        return "WorldMap.data";
    }

    /** 创建实体 */
    @Override
    protected WorldMapEntity MakeEntity(GameDataTableParser parse)
    {
        WorldMapEntity entity = new WorldMapEntity();
        entity.Id = parse.GetFieldValueToInt("Id");
        entity.Name = parse.GetFieldValueToUTF8String("Name");
        entity.SceneName = parse.GetFieldValueToUTF8String("SceneName");
        entity.SmallMapImg = parse.GetFieldValueToUTF8String("SmallMapImg");
        entity.NPCList = parse.GetFieldValueToUTF8String("NPCList");
        entity.RoleBirthPos = parse.GetFieldValueToUTF8String("RoleBirthPos");
        entity.CameraRotation = parse.GetFieldValueToUTF8String("CameraRotation");
        entity.TransPos = parse.GetFieldValueToUTF8String("TransPos");
        entity.IsCity = parse.GetFieldValueToInt("IsCity");
        entity.IsShowInMap = parse.GetFieldValueToInt("IsShowInMap");
        entity.PosInMap = parse.GetFieldValueToUTF8String("PosInMap");
        entity.IcoInMap = parse.GetFieldValueToUTF8String("IcoInMap");
        entity.NearScene = parse.GetFieldValueToUTF8String("NearScene");
        entity.Audio_BG = parse.GetFieldValueToUTF8String("Audio_BG");
        return entity;
    }
}
